<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglib.jsp" %>    
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>

	var org_setting = {
		check: {
			enable: false
		},
		data: {
			simpleData: {
				enable: true
			}
		},
        callback: {
            onClick: org_onTreeClick
        }
	};
	
	var sel_org_treeNodeId = null;
	var sel_org_treeNodeName = null;
	
	function org_onTreeClick(event, treeId, treeNode, clickFlag) {
		sel_org_treeNodeId = treeNode.id;
		sel_org_treeNodeName = treeNode.name;		
	}

	var org_Nodes = ${listOrganization};

	$(document).ready(function(){
		$.fn.zTree.init($("#orgTreeView"), org_setting, org_Nodes);
	});
	
	function btn_ok_click() {
		if (sel_org_treeNodeId == null) {
			alert("请选择组织");
			return;
   	 	}
		
		onSelectOrgEvent(sel_org_treeNodeId);
	}

</script>

</head>

<body>

<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
		&times;
	</button>
	<h4 class="modal-title">组织机构	</h4>
</div>

<div class="modal-body">
	<div>
	<ul id="orgTreeView" class="ztree"></ul>
	<br/>
	</div>
</div>

<div class="modal-footer">	
	<button type="button" class="btn btn-primary" onclick="btn_ok_click();">确定</button>
	<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>	
</div>
   	
</body>
</html>
